Conversation
This comment was marked as resolved.
This comment was marked as resolved.
- Add Zod schemas at API level for all request types with validateRequest() that throws RequestValidationError, caught by apiHandler for clean error output - Add handleValidationError() + buildArgumentMap() to map API field names to CLI argument names (e.g., title → --title) for user-friendly error messages - Move validation schemas from command-level to API-level as single source of truth; command handlers pass args directly to API functions - Add customFields, parameterValues, and filledTCaseTitleSuffixParams to test-case create/update commands with proper validation (parameterValues restricted to template type) - Fix jsonResponse null crash, expand ResultStatus with custom statuses, relax test-cases update check, extract shared superRefine for run schemas - Add tests for new fields (mocked + live) and batch-create validation errors
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
| msg.startsWith('Not enough non-option arguments') | ||
| ) { | ||
| yi.showHelp() | ||
| process.exit(0) |
There was a problem hiding this comment.
When invalid arguments are provided, it should return a non-zero exit code.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Review Summary
All 12+ previously raised issues across 20 review rounds have been resolved. The manifest-based rewrite is a major architectural improvement — ApiEndpointSpec with executeCommand centralizing validation/body processing/error handling cleanly eliminates the prior classes of bugs (yargs metadata leak, inconsistent validation, DRY violations).
2 minor inline comments posted (not blockers):
withHttpRetrydoesn't consume response bodies before retrying — potential socket leak under sustained rate-limitingupdateSearchParamsnested-object branch drops parent keys — latent bug in dead code
Test coverage observation (non-blocking): src/commands/api/utils.ts and executor.ts have no direct unit tests — formatApiError, handleApiValidationError, parseBodyInput, and validateFieldValues are only exercised indirectly through integration tests.
Security: Clean — path parameter validation via regex schemas, Zod enforcement at all API boundaries, no hardcoded credentials.
Well-structured PR overall.
Summary
Adds a new
qasphere apicommand that provides direct CLI access to the full QA Sphere public API. Users can now manage projects, test runs, test cases, results, and other resources programmatically without writing custom API integration code.What's included
projects,runs,test-cases,results,folders,milestones,tags,requirements,shared-steps,shared-preconditions,custom-fields,audit-logs,settings,test-plans,files,users[0].tcaseIds: not allowed for "live" runsQAS_URL/QAS_TOKENloaded only when the API is called, so CLI validation errors surface firstmaxSizeenforcement (e.g., 50 MiB for file uploads)npx skills add Hypersequent/qas-cliArchitecture
The API command uses a manifest-based pattern
Each endpoint is a plain declarative object — the builder and executor handle all yargs wiring, validation, and error handling generically
Other changes
audit-logs,custom-fields,milestones,requirements,results,settings,shared-preconditions,shared-steps,tags,test-plans,users,file— plus expandedruns,tcases,projects,foldersCLAUDE.mdupdated with full architecture docs for the manifest-based API commandREADME.mdupdated with usage documentationSKILL.mdadded for AI coding agent supportnpm audit fixapplied to dependenciesTesting
src/tests/api/organized by resource, one spec per action{ tags: ['live'] }test-helper.tswithuseMockServer(),runCli(),expectValidationError(), and atestfixture with project lifecycle managementglobal-setup.ts) handles live API authentication🤖 Generated with Claude Code